﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using MarketOnlineBUS;
using MarketOnlineDTO;
using System.Data;


public partial class cms_ManageBill : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            initNgayGio();
        }
    }

    public void initNgayGio()
    {
        DateTime d = new DateTime();
        d = DateTime.Now;

        

        cbNgay.Items.Add("--");
        for (int i = 1; i <= 31; i++)
            cbNgay.Items.Add(i.ToString());


        cbThang.Items.Add("--");
        for (int i = 1; i <= 12; i++)
            cbThang.Items.Add(i.ToString());

        cbNam.Items.Add("--");
        cbNam.Items.Add(d.Year.ToString());
        cbNam.Items.Add((d.Year + 1).ToString());



        cbNgay.SelectedValue = d.Day.ToString();
        cbThang.SelectedValue = d.Month.ToString();
        cbNam.SelectedValue = d.Year.ToString();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        DateTime d = new DateTime(int.Parse(cbNam.SelectedValue), int.Parse(cbThang.SelectedValue), int.Parse(cbNgay.SelectedValue));

        List<ThongKeDTO> list = new List<ThongKeDTO>();
        list = new ThongKeBUS().ThongKe(d);

        dgvThongKe.DataSource = list;
        dgvThongKe.DataBind();

    }
}